<%-- 
    Document   : response
    Created on : 27 févr. 2012, 15:30:47
    Author     : assia
--%>
<%@page import="java.text.ParseException"%>
<%@page import="java.text.ParseException"%>
<%@page import="com.sun.java.swing.plaf.windows.WindowsBorders.DashedBorder"%>
<%@page import="comits.web.client.servlets.DateUtil"%>
<%@page import="javax.print.DocFlavor.STRING"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.text.SimpleDateFormat"%>

<%@page import="java.util.Calendar"%>
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="d" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <title>JSP Page</title>
        <link href="styles.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
        <br></br>
        <br></br>
        <br></br>
        <div class="text" align="center">
            <%
                String datejour = (String) request.getAttribute("datejour");
                java.sql.Date d = new java.sql.Date(DateUtil.stringToDate(datejour).getTime());
                String NumCmd = (String) request.getAttribute("NumCmd");
                String expediteur = (String) request.getAttribute("expediteur");
                String numExpediteur = (String) request.getAttribute("numexpediteur");
                String destinataire = (String) request.getAttribute("destinataire");
                String numdestinataire = (String) request.getAttribute("numdestinataire");
                //out.println("le " + expediteur + " " + numExpediteur + " approvisionne " + " la " + destinataire + " " + numdestinataire);
                //out.println("la commande " + NumCmd + " " + datejour);

            %>  
            <h1>Détail des encours du <%=expediteur%>  <%=numExpediteur%>  au <%=destinataire%> <%=numdestinataire%>  </h1>
        </div>

        <sql:query var = "queryresults" dataSource = "jdbc/WebTest1" > 
            <%-- select distinct *  from comits_base.commande where WEEK(DateRecepPrevue)= <%=week%>   --%> 
            <%--  select * from comits_base.lignecmd  where DateReception like '<%=d%>' and NumExp='<%=numExpediteur%>' and Expediteur='<%=expediteur%>' 
              and NumDest='<%=numdestinataire%>' and  Destinataire='<%=destinataire%>'  
            --%>
            select * from comits_base.lignecmd  where DateReception like '<%=d%>' and NumCmd='<%=NumCmd%>' 

        </sql:query> 
        <div id="contener1"  >

            <table  id="table" border="0"  >


                <c:forEach var="row" items="${queryresults.rows}">
                    <tr align="center">
                        <td><c:out value="${row.NumCmd}" /></td>
                        <td><c:out value="${row.NumPdt}" /></td>
                        <td><c:out value="${row.Quantite}" /></td>
                        <td><c:out value="${row.DateReception}" /></td>
                        <td><c:out value="${row.DateStatut}" /></td> 
                        <td><c:out value="${row.Statut}" /></td> 

                    </tr>

                </c:forEach>  
            </table>

            <%--   <div id="pannel_1">
                   <c:forEach var="row" items="${queryresults.rows}" varStatus="status" >

                    <div  >   
                        <input  type="button"  name="action1" class="button"  value="${row.NumPdt}" />  

                    </div>
                    <br/>

                </c:forEach>
            </div>
            <div id="pannel_2">
                <c:forEach var="row" items="${queryresults.rows}" varStatus="status" >
                    <div >  

                        <input  type="button"  name="action1" class="button"  value="${row.NumPdt}" />  

                    </div>
                    <br/>
                </c:forEach>
            </div>
            <div id="pannel_3">
                <c:forEach var="row" items="${queryresults.rows}" varStatus="status" >
                    <div >  

                        <input  type="button"  name="action1" class="button"  value="${row.Quantite}" />  

                    </div>
                    <br/>
                </c:forEach>
            </div>
            <div id="pannel_4">
                <c:forEach var="row" items="${queryresults.rows}" varStatus="status" >
                    <div >  

                        <input  type="button"  name="action1" class="button"  value="${row.DateReception}" />  
                    </div>
                    <br/>
                </c:forEach>
            </div>
            <div id="pannel_5">
                <c:forEach var="row" items="${queryresults.rows}" varStatus="status" >
                    <div >  

                        <input  type="button"  name="action1" class="button"  value="${row.DateStatut}" />  
                    </div>
                    <br/>
                </c:forEach>
            </div>  
            <div id="pannel_6">
                <c:forEach var="row" items="${queryresults.rows}" varStatus="status" >
                    <div >  

                        <input  type="button"  name="action1" class="button"  value="${row.Statut}" />  

                    </div>
                    <br/>

                </c:forEach>
            </div>

            --%>


        </div>       

        <div id="bt_retoure"  >
            <div>
                <form action="PlanningServlet" method="get" >
                    <input type="hidden" name="action1"  class="boutton" value="${row.DateReception}"/>
                    <input   type="submit" name="action" class="button"  value="Retour" />  
                </form>
            </div>
        </div>    
        <div id="styletable">
            <table  id="table" border="2"  >

                <tr align="center">
                    <td>Numero Commande</td>
                    <td>Numero Produit</td>
                    <td>Quantite</td>
                    <td>Date Reception</td>
                    <td>Date Statut</td>
                    <td>Statut</td>

                </tr>
            </table>
        </div>
    </body>
</html>
